package com.xucy.springboot.designmodel.behavioral.interpreter;

/**
 * @Author xucy
 * @Date 2019-10-31 17:32
 * @Description
 **/

public class PlusOperation  extends NonTerminalExpression {
    public PlusOperation(Expression e1, Expression e2) {
        super(e1, e2);
    }

    //将两个表达式相加
    @Override
    public int interpreter(Context context) {
        return this.e1.interpreter(context) + this.e2.interpreter(context);
    }
}
